using System;
using System.Collections.Generic;
using System.Text;

namespace WatiN.Samples.Console
{
    /// <summary>
    /// 
    /// </summary>
    public static partial class SafeConvert
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static bool[] ToBoolean(string[] array)
        {
            return Array.ConvertAll<string, bool>(array, ToBoolean);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static double[] ToDouble(string[] array)
        {
            return Array.ConvertAll<string, double>(array, ToDouble);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static float[] ToSingle(string[] array)
        {
            return Array.ConvertAll<string, float>(array, ToSingle);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static decimal[] ToDecimal(string[] array)
        {
            return Array.ConvertAll<string, decimal>(array, ToDecimal);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static byte[] ToByte(string[] array)
        {
            return Array.ConvertAll<string, byte>(array, ToByte);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static sbyte[] ToSByte(string[] array)
        {
            return Array.ConvertAll<string, sbyte>(array, ToSByte);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static short[] ToInt16(string[] array)
        {
            return Array.ConvertAll<string, short>(array, ToInt16);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static ushort[] ToUInt16(string[] array)
        {
            return Array.ConvertAll<string, ushort>(array, ToUInt16);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static int[] ToInt32(string[] array)
        {
            return Array.ConvertAll< string, int >( array, ToInt32 );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static uint[] ToUInt32(string[] array)
        {
            return Array.ConvertAll<string, uint>(array, ToUInt32);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static long[] ToInt64(string[] array)
        {
            return Array.ConvertAll<string, long>(array, ToInt64);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static ulong[] ToUInt64(string[] array)
        {
            return Array.ConvertAll<string, ulong>(array, ToUInt64);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static DateTime[] ToDateTime(string[] array)
        {
            return Array.ConvertAll<string, DateTime>(array, ToDateTime);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static TimeSpan[] ToTimeSpan(string[] array)
        {
            return Array.ConvertAll<string, TimeSpan>(array, ToTimeSpan);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static char[] ToChar(string[] array)
        {
            return Array.ConvertAll<string, char>(array, ToChar);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static string[] ToString(object[] array)
        {
            return Array.ConvertAll<object, string>(array, ToString);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static T[] ToEnum<T>(string[] array) where T : struct
        {
            return Array.ConvertAll<string, T>(array, ToEnum<T>);
        }

    }
}
